#ifndef _NAME_SVR_CLIENT_PROTO_HELPER_H_
#define _NAME_SVR_CLIENT_PROTO_HELPER_H_

#include <string>


#include "NameSvrClient.h"

using std::string;

string ns_build_request_create_file(const char * file_path, int32_t mds_id, int32_t dir_id, int64_t file_id);
string ns_build_request_delete_file(const char * file_path);
string ns_build_request_create_dir(const char * dir_path);
string ns_build_request_delete_dir(const char * dir_path);
string ns_build_request_get_file_metadata_info(const char * file_path);
string ns_build_request_alloc_mds_4_new_file();
string ns_build_request_query_is_file_exist(const char * file_path);
string ns_build_request_query_is_dir_exist(const char * dir_path);
string ns_build_request_read_dir(const char * dir_path);


int ns_parse_response_create_file(const char * response, int32_t & result);
int ns_parse_response_delete_file(const char * response, int32_t & result);
int ns_parse_response_create_dir(const char * response, int32_t & result);
int ns_parse_response_delete_dir(const char * response, int32_t & result);
int ns_parse_response_get_file_metadata_info(const char * response, int32_t & result, FILE_METADATA_INFO & info);
int ns_parse_response_alloc_mds_4_new_file(const char * response, int32_t & result, int32_t & mds_id);
int ns_parse_response_query_is_file_exist(const char * response, int32_t & result, int32_t & exist_flag);
int ns_parse_response_query_is_dir_exist(const char * response, int32_t & result, int32_t & exist_flag);
int ns_parse_response_read_dir(const char * response, int32_t & result, list<string> & entries);

#endif
